<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Emulateur PROCSI:  Fichier source de /home/aboursie/workspace/emulator-procsi/src/instructions.c</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Généré par Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Recherche');
--></script>
<div id="top">
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Emulateur PROCSI&#160;<span id="projectnumber">1</span></div>
   <div id="projectbrief">reproduction du fonctionnement de PROCSI en C</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Page&#160;principale</span></a></li>
      <li><a href="annotated.html"><span>Structures&#160;de&#160;données</span></a></li>
      <li class="current"><a href="files.html"><span>Fichiers</span></a></li>
      <li id="searchli">
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Recherche" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>Liste&#160;des&#160;fichiers</span></a></li>
      <li><a href="globals.html"><span>Portée&#160;globale</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<div class="title">/home/aboursie/workspace/emulator-procsi/src/instructions.c</div>  </div>
</div>
<div class="contents">
<a href="instructions_8c.html">Aller à la documentation de ce fichier.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#include &quot;<a class="code" href="instructions_8h.html">instructions.h</a>&quot;</span>
<a name="l00002"></a>00002 <span class="preprocessor">#include &quot;<a class="code" href="pvm_8h.html">pvm.h</a>&quot;</span>
<a name="l00003"></a>00003 
<a name="l00014"></a><a class="code" href="instructions_8c.html#a68b3a4e1cfc5a7c04782490fb93540ce">00014</a> <span class="keywordtype">bool</span> <a class="code" href="instructions_8c.html#a68b3a4e1cfc5a7c04782490fb93540ce">load</a>(<a class="code" href="struct_p_v_m.html">PVM</a> *pvm, <a class="code" href="pvm_8h.html#a9e9b08bbbfb50d0535079872d3ed87c3">REG</a> *dest, <a class="code" href="union_mot.html">Mot</a> source)
<a name="l00015"></a>00015 {
<a name="l00016"></a>00016         *dest = source.<a class="code" href="union_mot.html#a0414480f7d1e00c252db4cb3501201e6">brut</a>;
<a name="l00017"></a>00017         <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00018"></a>00018 }
<a name="l00019"></a>00019 
<a name="l00030"></a><a class="code" href="instructions_8c.html#a2bfed01e9ef4241d3f02dcfba3ee670c">00030</a> <span class="keywordtype">bool</span> <a class="code" href="instructions_8c.html#a2bfed01e9ef4241d3f02dcfba3ee670c">store</a>(<a class="code" href="struct_p_v_m.html">PVM</a> *pvm, <a class="code" href="pvm_8h.html#a9e9b08bbbfb50d0535079872d3ed87c3">REG</a> *dest, <a class="code" href="union_mot.html">Mot</a> source)
<a name="l00031"></a>00031 {
<a name="l00032"></a>00032         *dest = source.<a class="code" href="union_mot.html#a0414480f7d1e00c252db4cb3501201e6">brut</a>;
<a name="l00033"></a>00033         <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00034"></a>00034 }
<a name="l00035"></a>00035 
<a name="l00046"></a><a class="code" href="instructions_8c.html#aff4b307f35be75ee82b5b5ae7cfdf15c">00046</a> <span class="keywordtype">bool</span> <a class="code" href="instructions_8c.html#aff4b307f35be75ee82b5b5ae7cfdf15c">add</a>(<a class="code" href="struct_p_v_m.html">PVM</a> *<a class="code" href="struct_p_v_m.html">PVM</a>, <a class="code" href="pvm_8h.html#a9e9b08bbbfb50d0535079872d3ed87c3">REG</a> *dest, <a class="code" href="union_mot.html">Mot</a> source)
<a name="l00047"></a>00047 {
<a name="l00048"></a>00048         *dest += source.<a class="code" href="union_mot.html#a0414480f7d1e00c252db4cb3501201e6">brut</a>;
<a name="l00049"></a>00049         PVM-&gt;<a class="code" href="struct_p_v_m.html#a4b94d3b0c007f78c25c791e6b506307c">sr</a> = *dest;
<a name="l00050"></a>00050         <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00051"></a>00051 }
<a name="l00052"></a>00052 
<a name="l00063"></a><a class="code" href="instructions_8c.html#ad74266f266163a92f2f9c2df64134fe8">00063</a> <span class="keywordtype">bool</span> <a class="code" href="instructions_8c.html#ad74266f266163a92f2f9c2df64134fe8">sub</a>(<a class="code" href="struct_p_v_m.html">PVM</a> *<a class="code" href="struct_p_v_m.html">PVM</a>, <a class="code" href="pvm_8h.html#a9e9b08bbbfb50d0535079872d3ed87c3">REG</a> *dest, <a class="code" href="union_mot.html">Mot</a> source)
<a name="l00064"></a>00064 {
<a name="l00065"></a>00065         *dest -= source.<a class="code" href="union_mot.html#a0414480f7d1e00c252db4cb3501201e6">brut</a>;
<a name="l00066"></a>00066         PVM-&gt;<a class="code" href="struct_p_v_m.html#a4b94d3b0c007f78c25c791e6b506307c">sr</a> = *dest;
<a name="l00067"></a>00067         <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00068"></a>00068 }
<a name="l00069"></a>00069 
<a name="l00080"></a><a class="code" href="instructions_8c.html#abd060e26c7849831f787bd488eec10d5">00080</a> <span class="keywordtype">bool</span> <a class="code" href="instructions_8c.html#abd060e26c7849831f787bd488eec10d5">jmp</a>(<a class="code" href="struct_p_v_m.html">PVM</a> *<a class="code" href="struct_p_v_m.html">PVM</a>, <a class="code" href="pvm_8h.html#a9e9b08bbbfb50d0535079872d3ed87c3">REG</a> *dest, <a class="code" href="union_mot.html">Mot</a> source)
<a name="l00081"></a>00081 {
<a name="l00082"></a>00082         <span class="keywordflow">if</span> (!<a class="code" href="pvm_8c.html#a570d5566d9630e7cc1d6f082d19158f9">verifierAccesMemoire</a>(&amp;source.<a class="code" href="union_mot.html#a0414480f7d1e00c252db4cb3501201e6">brut</a>))
<a name="l00083"></a>00083                 <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00084"></a>00084 
<a name="l00085"></a>00085         <span class="keywordflow">if</span> (source.<a class="code" href="union_mot.html#a0414480f7d1e00c252db4cb3501201e6">brut</a> == PVM-&gt;<a class="code" href="struct_p_v_m.html#a86b158606e5e1308f972b34b071fc754">pc</a> || source.<a class="code" href="union_mot.html#a0414480f7d1e00c252db4cb3501201e6">brut</a> == PVM-&gt;<a class="code" href="struct_p_v_m.html#a86b158606e5e1308f972b34b071fc754">pc</a> - 1)
<a name="l00086"></a>00086                 printf(<span class="stringliteral">&quot;Boucle infinie&quot;</span>);
<a name="l00087"></a>00087         PVM-&gt;<a class="code" href="struct_p_v_m.html#a86b158606e5e1308f972b34b071fc754">pc</a> = source.<a class="code" href="union_mot.html#a0414480f7d1e00c252db4cb3501201e6">brut</a> - 1;
<a name="l00088"></a>00088         <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00089"></a>00089 }
<a name="l00090"></a>00090 
<a name="l00101"></a><a class="code" href="instructions_8c.html#a2c4152e2390031a1b88d852f12f25c6f">00101</a> <span class="keywordtype">bool</span> <a class="code" href="instructions_8c.html#a2c4152e2390031a1b88d852f12f25c6f">jeq</a>(<a class="code" href="struct_p_v_m.html">PVM</a> *<a class="code" href="struct_p_v_m.html">PVM</a>, <a class="code" href="pvm_8h.html#a9e9b08bbbfb50d0535079872d3ed87c3">REG</a> *dest, <a class="code" href="union_mot.html">Mot</a> source)
<a name="l00102"></a>00102 {
<a name="l00103"></a>00103         <span class="keywordflow">if</span> (PVM-&gt;<a class="code" href="struct_p_v_m.html#a4b94d3b0c007f78c25c791e6b506307c">sr</a> == 0)
<a name="l00104"></a>00104                 <span class="keywordflow">return</span> <a class="code" href="instructions_8c.html#abd060e26c7849831f787bd488eec10d5">jmp</a>(PVM, dest, source);
<a name="l00105"></a>00105         <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00106"></a>00106 }
<a name="l00107"></a>00107 
<a name="l00118"></a><a class="code" href="instructions_8c.html#a41a3876805815f79bfcc4bc8b206c958">00118</a> <span class="keywordtype">bool</span> <a class="code" href="instructions_8c.html#a41a3876805815f79bfcc4bc8b206c958">push</a>(<a class="code" href="struct_p_v_m.html">PVM</a> *<a class="code" href="struct_p_v_m.html">PVM</a>, <a class="code" href="pvm_8h.html#a9e9b08bbbfb50d0535079872d3ed87c3">REG</a> *dest, <a class="code" href="union_mot.html">Mot</a> source)
<a name="l00119"></a>00119 {
<a name="l00120"></a>00120         <a class="code" href="pvm_8h.html#a9e9b08bbbfb50d0535079872d3ed87c3">REG</a> newSp = PVM-&gt;<a class="code" href="struct_p_v_m.html#a8eed1a2f252c69524a03e13d47bdd7ea">sp</a> + <a class="code" href="pvm_8h.html#ab54743bd28a2e3157970d2f5bd35a673">SP_INCR</a>;
<a name="l00121"></a>00121 
<a name="l00122"></a>00122         <span class="keywordflow">if</span> ((!<a class="code" href="pvm_8c.html#a570d5566d9630e7cc1d6f082d19158f9">verifierAccesMemoire</a>(&amp;PVM-&gt;<a class="code" href="struct_p_v_m.html#a8eed1a2f252c69524a03e13d47bdd7ea">sp</a>)) || (! <a class="code" href="pvm_8c.html#a570d5566d9630e7cc1d6f082d19158f9">verifierAccesMemoire</a>(&amp;newSp)))
<a name="l00123"></a>00123                 <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00124"></a>00124 
<a name="l00125"></a>00125         PVM-&gt;<a class="code" href="struct_p_v_m.html#a90409607a9d10e5fe64eeb9e187dccaa">mem</a>[PVM-&gt;<a class="code" href="struct_p_v_m.html#a8eed1a2f252c69524a03e13d47bdd7ea">sp</a>] = source;
<a name="l00126"></a>00126         PVM-&gt;<a class="code" href="struct_p_v_m.html#a8eed1a2f252c69524a03e13d47bdd7ea">sp</a> = newSp;
<a name="l00127"></a>00127         <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00128"></a>00128 }
<a name="l00129"></a>00129 
<a name="l00140"></a><a class="code" href="instructions_8c.html#ad88c707bafeaae8e1cb8a6dfbdbd0a57">00140</a> <span class="keywordtype">bool</span> <a class="code" href="instructions_8c.html#ad88c707bafeaae8e1cb8a6dfbdbd0a57">pop</a>(<a class="code" href="struct_p_v_m.html">PVM</a> *<a class="code" href="struct_p_v_m.html">PVM</a>, <a class="code" href="pvm_8h.html#a9e9b08bbbfb50d0535079872d3ed87c3">REG</a> *dest, <a class="code" href="union_mot.html">Mot</a> source)
<a name="l00141"></a>00141 {
<a name="l00142"></a>00142         <a class="code" href="pvm_8h.html#a9e9b08bbbfb50d0535079872d3ed87c3">REG</a> newSp = PVM-&gt;<a class="code" href="struct_p_v_m.html#a8eed1a2f252c69524a03e13d47bdd7ea">sp</a> - <a class="code" href="pvm_8h.html#ab54743bd28a2e3157970d2f5bd35a673">SP_INCR</a>;
<a name="l00143"></a>00143 
<a name="l00144"></a>00144         <span class="keywordflow">if</span> (!<a class="code" href="pvm_8c.html#a570d5566d9630e7cc1d6f082d19158f9">verifierAccesMemoire</a>(&amp;newSp))
<a name="l00145"></a>00145                 <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00146"></a>00146 
<a name="l00147"></a>00147         *dest = PVM-&gt;<a class="code" href="struct_p_v_m.html#a7d56b6424277070bd8b03400125dc04a">reg</a>[PVM-&gt;<a class="code" href="struct_p_v_m.html#a90409607a9d10e5fe64eeb9e187dccaa">mem</a>[newSp].<a class="code" href="union_mot.html#a086679e3803f06fa3a2261ef75479833">codage</a>.<a class="code" href="union_mot.html#a8cc654c8b1f1628a5b32821309615135">dest</a>];
<a name="l00148"></a>00148         PVM-&gt;<a class="code" href="struct_p_v_m.html#a8eed1a2f252c69524a03e13d47bdd7ea">sp</a> = newSp;
<a name="l00149"></a>00149         <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00150"></a>00150 }
<a name="l00151"></a>00151 
<a name="l00162"></a><a class="code" href="instructions_8c.html#aaa91897391b38ed77a3bd54984d3226e">00162</a> <span class="keywordtype">bool</span> <a class="code" href="instructions_8c.html#aaa91897391b38ed77a3bd54984d3226e">call</a>(<a class="code" href="struct_p_v_m.html">PVM</a> *<a class="code" href="struct_p_v_m.html">PVM</a>, <a class="code" href="pvm_8h.html#a9e9b08bbbfb50d0535079872d3ed87c3">REG</a> *dest, <a class="code" href="union_mot.html">Mot</a> source)
<a name="l00163"></a>00163 {
<a name="l00164"></a>00164         <span class="keywordflow">if</span> (!<a class="code" href="instructions_8c.html#a41a3876805815f79bfcc4bc8b206c958">push</a>(PVM, dest, (<a class="code" href="union_mot.html">Mot</a>) PVM-&gt;<a class="code" href="struct_p_v_m.html#a86b158606e5e1308f972b34b071fc754">pc</a>))
<a name="l00165"></a>00165                 <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00166"></a>00166 
<a name="l00167"></a>00167         <span class="keywordtype">int</span> i;
<a name="l00168"></a>00168         <span class="keywordflow">for</span> (i = 0; i &lt; <a class="code" href="pvm_8h.html#aa5567626531b8873c1f7d93b4b7c5319">NREGS</a>; i++)
<a name="l00169"></a>00169         {
<a name="l00170"></a>00170                 <span class="keywordflow">if</span> (!<a class="code" href="instructions_8c.html#a41a3876805815f79bfcc4bc8b206c958">push</a>(PVM, dest, (<a class="code" href="union_mot.html">Mot</a>) PVM-&gt;<a class="code" href="struct_p_v_m.html#a7d56b6424277070bd8b03400125dc04a">reg</a>[i]))
<a name="l00171"></a>00171                         <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00172"></a>00172         }
<a name="l00173"></a>00173 
<a name="l00174"></a>00174         <span class="keywordflow">return</span> <a class="code" href="instructions_8c.html#abd060e26c7849831f787bd488eec10d5">jmp</a>(PVM, dest, source);
<a name="l00175"></a>00175 }
<a name="l00176"></a>00176 
<a name="l00187"></a><a class="code" href="instructions_8c.html#a195a66484957f10ea3b413db377d1c5b">00187</a> <span class="keywordtype">bool</span> <a class="code" href="instructions_8c.html#a195a66484957f10ea3b413db377d1c5b">ret</a>(<a class="code" href="struct_p_v_m.html">PVM</a> *<a class="code" href="struct_p_v_m.html">PVM</a>, <a class="code" href="pvm_8h.html#a9e9b08bbbfb50d0535079872d3ed87c3">REG</a> *dest, <a class="code" href="union_mot.html">Mot</a> source)
<a name="l00188"></a>00188 {
<a name="l00189"></a>00189         <span class="keywordtype">int</span> i;
<a name="l00190"></a>00190         <span class="keywordflow">for</span> (i = <a class="code" href="pvm_8h.html#aa5567626531b8873c1f7d93b4b7c5319">NREGS</a> - 1; i &gt;= 0; i--)
<a name="l00191"></a>00191         {
<a name="l00192"></a>00192                 <span class="keywordflow">if</span> (!<a class="code" href="instructions_8c.html#ad88c707bafeaae8e1cb8a6dfbdbd0a57">pop</a>(PVM, &amp;PVM-&gt;<a class="code" href="struct_p_v_m.html#a7d56b6424277070bd8b03400125dc04a">reg</a>[i], source))
<a name="l00193"></a>00193                         <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00194"></a>00194         }
<a name="l00195"></a>00195 
<a name="l00196"></a>00196         <span class="keywordflow">return</span> <a class="code" href="instructions_8c.html#ad88c707bafeaae8e1cb8a6dfbdbd0a57">pop</a>(PVM, &amp;PVM-&gt;<a class="code" href="struct_p_v_m.html#a86b158606e5e1308f972b34b071fc754">pc</a>, source);
<a name="l00197"></a>00197 }
<a name="l00198"></a>00198 
<a name="l00209"></a><a class="code" href="instructions_8c.html#a932a73b54d210bd68f31a1c88e885721">00209</a> <span class="keywordtype">bool</span> <a class="code" href="instructions_8c.html#a932a73b54d210bd68f31a1c88e885721">halt</a>(<a class="code" href="struct_p_v_m.html">PVM</a> *<a class="code" href="struct_p_v_m.html">PVM</a>, <a class="code" href="pvm_8h.html#a9e9b08bbbfb50d0535079872d3ed87c3">REG</a> *dest, <a class="code" href="union_mot.html">Mot</a> source)
<a name="l00210"></a>00210 {
<a name="l00211"></a>00211         printf(<span class="stringliteral">&quot;HALT instruction, programme terminé&quot;</span>);
<a name="l00212"></a>00212         <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00213"></a>00213 }
<a name="l00214"></a>00214 
<a name="l00215"></a>00215 <span class="comment">//---------------------------------------------------------------------------------------//</span>
<a name="l00216"></a>00216 <span class="comment">// -------------------- COMMANDES SUPPLEMENTAIRES IMPLEMENTEES --------------------------//</span>
<a name="l00217"></a>00217 <span class="comment">//---------------------------------------------------------------------------------------//</span>
<a name="l00218"></a>00218 
<a name="l00229"></a><a class="code" href="instructions_8c.html#a6ff943921cdd011dd58cbbde7520a382">00229</a> <span class="keywordtype">bool</span> <a class="code" href="instructions_8c.html#a6ff943921cdd011dd58cbbde7520a382">mov</a>(<a class="code" href="struct_p_v_m.html">PVM</a> *<a class="code" href="struct_p_v_m.html">PVM</a>, <a class="code" href="pvm_8h.html#a9e9b08bbbfb50d0535079872d3ed87c3">REG</a> *dest, <a class="code" href="union_mot.html">Mot</a> source)
<a name="l00230"></a>00230 {
<a name="l00231"></a>00231         *dest = source.<a class="code" href="union_mot.html#a0414480f7d1e00c252db4cb3501201e6">brut</a>;
<a name="l00232"></a>00232         PVM-&gt;<a class="code" href="struct_p_v_m.html#a4b94d3b0c007f78c25c791e6b506307c">sr</a> = *dest;
<a name="l00233"></a>00233         <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00234"></a>00234 }
<a name="l00235"></a>00235 
<a name="l00246"></a><a class="code" href="instructions_8c.html#aba01d22a575963738fb9e270009d912d">00246</a> <span class="keywordtype">bool</span> <a class="code" href="instructions_8c.html#aba01d22a575963738fb9e270009d912d">and</a>(<a class="code" href="struct_p_v_m.html">PVM</a> *<a class="code" href="struct_p_v_m.html">PVM</a>, <a class="code" href="pvm_8h.html#a9e9b08bbbfb50d0535079872d3ed87c3">REG</a> *dest, <a class="code" href="union_mot.html">Mot</a> source)
<a name="l00247"></a>00247 {
<a name="l00248"></a>00248         *dest &amp;= source.<a class="code" href="union_mot.html#a0414480f7d1e00c252db4cb3501201e6">brut</a>;
<a name="l00249"></a>00249         PVM-&gt;<a class="code" href="struct_p_v_m.html#a4b94d3b0c007f78c25c791e6b506307c">sr</a> = *dest;
<a name="l00250"></a>00250         <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00251"></a>00251 }
<a name="l00252"></a>00252 
<a name="l00263"></a><a class="code" href="instructions_8c.html#ab22d6f3ef5279108fcf0b91f4dcaf7b4">00263</a> <span class="keywordtype">bool</span> <a class="code" href="instructions_8c.html#ab22d6f3ef5279108fcf0b91f4dcaf7b4">or</a>(<a class="code" href="struct_p_v_m.html">PVM</a> *<a class="code" href="struct_p_v_m.html">PVM</a>, <a class="code" href="pvm_8h.html#a9e9b08bbbfb50d0535079872d3ed87c3">REG</a> *dest, <a class="code" href="union_mot.html">Mot</a> source)
<a name="l00264"></a>00264 {
<a name="l00265"></a>00265         *dest |= source.<a class="code" href="union_mot.html#a0414480f7d1e00c252db4cb3501201e6">brut</a>;
<a name="l00266"></a>00266         PVM-&gt;<a class="code" href="struct_p_v_m.html#a4b94d3b0c007f78c25c791e6b506307c">sr</a> = *dest;
<a name="l00267"></a>00267         <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00268"></a>00268 }
<a name="l00269"></a>00269 
<a name="l00280"></a><a class="code" href="instructions_8c.html#a313efd5364311048ac627a0375ac81e9">00280</a> <span class="keywordtype">bool</span> <a class="code" href="instructions_8c.html#a313efd5364311048ac627a0375ac81e9">shl</a>(<a class="code" href="struct_p_v_m.html">PVM</a> *<a class="code" href="struct_p_v_m.html">PVM</a>, <a class="code" href="pvm_8h.html#a9e9b08bbbfb50d0535079872d3ed87c3">REG</a> *dest, <a class="code" href="union_mot.html">Mot</a> source)
<a name="l00281"></a>00281 {
<a name="l00282"></a>00282         *dest &lt;&lt;= source.<a class="code" href="union_mot.html#a0414480f7d1e00c252db4cb3501201e6">brut</a>;
<a name="l00283"></a>00283         PVM-&gt;<a class="code" href="struct_p_v_m.html#a4b94d3b0c007f78c25c791e6b506307c">sr</a> = *dest;
<a name="l00284"></a>00284         <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00285"></a>00285 }
<a name="l00286"></a>00286 
<a name="l00297"></a><a class="code" href="instructions_8c.html#a7adb5afae358836797b1e1308fd67288">00297</a> <span class="keywordtype">bool</span> <a class="code" href="instructions_8c.html#a7adb5afae358836797b1e1308fd67288">shr</a>(<a class="code" href="struct_p_v_m.html">PVM</a> *<a class="code" href="struct_p_v_m.html">PVM</a>, <a class="code" href="pvm_8h.html#a9e9b08bbbfb50d0535079872d3ed87c3">REG</a> *dest, <a class="code" href="union_mot.html">Mot</a> source)
<a name="l00298"></a>00298 {
<a name="l00299"></a>00299         *dest &gt;&gt;= source.<a class="code" href="union_mot.html#a0414480f7d1e00c252db4cb3501201e6">brut</a>;
<a name="l00300"></a>00300         PVM-&gt;<a class="code" href="struct_p_v_m.html#a4b94d3b0c007f78c25c791e6b506307c">sr</a> = *dest;
<a name="l00301"></a>00301         <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00302"></a>00302 }
<a name="l00303"></a>00303 
<a name="l00314"></a><a class="code" href="instructions_8c.html#a3c7f81e99235c86823c9056dbdc4d446">00314</a> <span class="keywordtype">bool</span> <a class="code" href="instructions_8c.html#a3c7f81e99235c86823c9056dbdc4d446">cmp</a>(<a class="code" href="struct_p_v_m.html">PVM</a> *<a class="code" href="struct_p_v_m.html">PVM</a>, <a class="code" href="pvm_8h.html#a9e9b08bbbfb50d0535079872d3ed87c3">REG</a> *dest, <a class="code" href="union_mot.html">Mot</a> source)
<a name="l00315"></a>00315 {
<a name="l00316"></a>00316         PVM-&gt;<a class="code" href="struct_p_v_m.html#a4b94d3b0c007f78c25c791e6b506307c">sr</a> = (*dest - source.<a class="code" href="union_mot.html#a0414480f7d1e00c252db4cb3501201e6">brut</a>);
<a name="l00317"></a>00317         <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00318"></a>00318 }
<a name="l00319"></a>00319 
<a name="l00330"></a><a class="code" href="instructions_8c.html#a891774e80f779def65f4abc409c50d94">00330</a> <span class="keywordtype">bool</span> <a class="code" href="instructions_8c.html#a891774e80f779def65f4abc409c50d94">dec</a>(<a class="code" href="struct_p_v_m.html">PVM</a> *<a class="code" href="struct_p_v_m.html">PVM</a>, <a class="code" href="pvm_8h.html#a9e9b08bbbfb50d0535079872d3ed87c3">REG</a> *dest, <a class="code" href="union_mot.html">Mot</a> source)
<a name="l00331"></a>00331 {
<a name="l00332"></a>00332         --(*dest);
<a name="l00333"></a>00333         PVM-&gt;<a class="code" href="struct_p_v_m.html#a4b94d3b0c007f78c25c791e6b506307c">sr</a> = *dest;
<a name="l00334"></a>00334         <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00335"></a>00335 }
<a name="l00336"></a>00336 
<a name="l00341"></a><a class="code" href="instructions_8c.html#ab63961b02c507d5f06c9c3c5fc5dd0ef">00341</a> <a class="code" href="struct_instruction.html">Instruction</a> <a class="code" href="instructions_8c.html#ab63961b02c507d5f06c9c3c5fc5dd0ef">tabInstructions</a>[]  = {
<a name="l00342"></a>00342                 [<a class="code" href="pvm_8h.html#a7e52f419c66934d2886b2abb42b69994a972dbcdf74cff71e20bdcfb53be9c391">LOAD</a>]  = {&amp;<a class="code" href="instructions_8c.html#a68b3a4e1cfc5a7c04782490fb93540ce">load</a>, <span class="keyword">true</span>, <span class="keyword">true</span>},
<a name="l00343"></a>00343                 [<a class="code" href="pvm_8h.html#a7e52f419c66934d2886b2abb42b69994afeb01cb4572ba190cd7932e49446c480">STORE</a>] = {&amp;<a class="code" href="instructions_8c.html#a2bfed01e9ef4241d3f02dcfba3ee670c">store</a>, <span class="keyword">true</span>, <span class="keyword">true</span>},
<a name="l00344"></a>00344                 [<a class="code" href="pvm_8h.html#a7e52f419c66934d2886b2abb42b69994acfcf145f2788bf340ff3f3098bc54909">ADD</a>]   = {&amp;<a class="code" href="instructions_8c.html#aff4b307f35be75ee82b5b5ae7cfdf15c">add</a>, <span class="keyword">true</span>, <span class="keyword">true</span>},
<a name="l00345"></a>00345                 [<a class="code" href="pvm_8h.html#a7e52f419c66934d2886b2abb42b69994a12b733d4941495e86811fe6ceeeff9da">SUB</a>]   = {&amp;<a class="code" href="instructions_8c.html#ad74266f266163a92f2f9c2df64134fe8">sub</a>, <span class="keyword">true</span>, <span class="keyword">true</span>},
<a name="l00346"></a>00346                 [<a class="code" href="pvm_8h.html#a7e52f419c66934d2886b2abb42b69994a227d95ecea3ff1219ddb58bb03d17d5a">JMP</a>]   = {&amp;<a class="code" href="instructions_8c.html#abd060e26c7849831f787bd488eec10d5">jmp</a>, <span class="keyword">false</span>, <span class="keyword">true</span>},
<a name="l00347"></a>00347                 [<a class="code" href="pvm_8h.html#a7e52f419c66934d2886b2abb42b69994aab36b821b5ebc3977ed6f898b2bca097">JEQ</a>]   = {&amp;<a class="code" href="instructions_8c.html#a2c4152e2390031a1b88d852f12f25c6f">jeq</a>, <span class="keyword">false</span>, <span class="keyword">true</span>},
<a name="l00348"></a>00348                 [<a class="code" href="pvm_8h.html#a7e52f419c66934d2886b2abb42b69994abd0ebc08c262bab82a1882256d2d66e8">CALL</a>]  = {&amp;<a class="code" href="instructions_8c.html#aaa91897391b38ed77a3bd54984d3226e">call</a>, <span class="keyword">false</span>, <span class="keyword">true</span>},
<a name="l00349"></a>00349                 [<a class="code" href="pvm_8h.html#a7e52f419c66934d2886b2abb42b69994ab2510768eaba5e52ba71678e19a65464">RET</a>]   = {&amp;<a class="code" href="instructions_8c.html#a195a66484957f10ea3b413db377d1c5b">ret</a>, <span class="keyword">false</span>, <span class="keyword">false</span>},
<a name="l00350"></a>00350                 [<a class="code" href="pvm_8h.html#a7e52f419c66934d2886b2abb42b69994ad263caec619c4d99e4684ba0fabd9493">PUSH</a>]  = {&amp;<a class="code" href="instructions_8c.html#a41a3876805815f79bfcc4bc8b206c958">push</a>, <span class="keyword">false</span>, <span class="keyword">true</span>},
<a name="l00351"></a>00351                 [<a class="code" href="pvm_8h.html#a7e52f419c66934d2886b2abb42b69994a061dcf4785583d8653942f2d252174fa">POP</a>]   = {&amp;<a class="code" href="instructions_8c.html#ad88c707bafeaae8e1cb8a6dfbdbd0a57">pop</a>, <span class="keyword">true</span>, <span class="keyword">false</span>},
<a name="l00352"></a>00352                 [<a class="code" href="pvm_8h.html#a7e52f419c66934d2886b2abb42b69994aa2fd6bbb0c07e28e835ba595e64df78c">HALT</a>]  = {&amp;<a class="code" href="instructions_8c.html#a932a73b54d210bd68f31a1c88e885721">halt</a>, <span class="keyword">false</span>, <span class="keyword">false</span>},
<a name="l00353"></a>00353                 [<a class="code" href="pvm_8h.html#a7e52f419c66934d2886b2abb42b69994aa1535ce8fd6caf08009dcae925741d9b">MOV</a>]   = {&amp;<a class="code" href="instructions_8c.html#a6ff943921cdd011dd58cbbde7520a382">mov</a>, <span class="keyword">true</span>, <span class="keyword">true</span>},
<a name="l00354"></a>00354                 [<a class="code" href="pvm_8h.html#a7e52f419c66934d2886b2abb42b69994a865555c9f2e0458a7078486aa1b3254f">AND</a>]   = {&amp;<a class="code" href="instructions_8c.html#aba01d22a575963738fb9e270009d912d">and</a>, <span class="keyword">true</span>, <span class="keyword">true</span>},
<a name="l00355"></a>00355                 [<a class="code" href="pvm_8h.html#a7e52f419c66934d2886b2abb42b69994a96727447c0ad447987df1c6415aef074">OR</a>]    = {&amp;<a class="code" href="instructions_8c.html#ab22d6f3ef5279108fcf0b91f4dcaf7b4">or</a>, <span class="keyword">true</span>, <span class="keyword">true</span>},
<a name="l00356"></a>00356                 [<a class="code" href="pvm_8h.html#a7e52f419c66934d2886b2abb42b69994a9317069525638431dacf6c9ce1643e80">SHL</a>]   = {&amp;<a class="code" href="instructions_8c.html#a313efd5364311048ac627a0375ac81e9">shl</a>, <span class="keyword">true</span>, <span class="keyword">true</span>},
<a name="l00357"></a>00357                 [<a class="code" href="pvm_8h.html#a7e52f419c66934d2886b2abb42b69994adea444991c90042dd6201f2a83ad309d">SHR</a>]   = {&amp;<a class="code" href="instructions_8c.html#a7adb5afae358836797b1e1308fd67288">shr</a>, <span class="keyword">true</span>, <span class="keyword">true</span>},
<a name="l00358"></a>00358                 <span class="comment">//[CMP] = {&amp;cmp, true, true},</span>
<a name="l00359"></a>00359                 <span class="comment">//[DEC] = &amp;dec</span>
<a name="l00360"></a>00360 };
<a name="l00361"></a>00361 
<a name="l00370"></a><a class="code" href="instructions_8h.html#a8928bbf55f0640dc8aab155599552272">00370</a> <a class="code" href="struct_instruction.html">Instruction</a> <a class="code" href="instructions_8c.html#a8928bbf55f0640dc8aab155599552272">getInstruction</a>(<span class="keyword">const</span> <a class="code" href="union_mot.html">Mot</a> m)
<a name="l00371"></a>00371 {
<a name="l00372"></a>00372         <span class="keywordflow">return</span> tabInstructions[m.<a class="code" href="union_mot.html#a086679e3803f06fa3a2261ef75479833">codage</a>.<a class="code" href="union_mot.html#a714efb2f738953c61ec3e11c82a0e5b6">codeop</a>];
<a name="l00373"></a>00373 }
</pre></div></div>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>Tout</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Structures de données</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Fichiers</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Fonctions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Définition de type</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Énumérations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Valeurs énumérées</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Macros</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<hr class="footer"/><address class="footer"><small>Généré le Sat Dec 31 2011 13:00:38 pour Emulateur PROCSI par&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>
